var t = require("../../../@babel/runtime/helpers/interopRequireDefault")(require("../../../utils/util")), e = getApp();

Page({
    data: {
        locationStatus: !1,
        goodsId: null,
        storeName: "",
        longitude: "",
        latitude: "",
        timer: "",
        storeListByGoods: []
    },
    onLoad: function(t) {
        this.setData({
            goodsId: Number(t.goodsId),
            longitude: t.longitude,
            latitude: t.latitude
        }), this.getStoreListByGoods();
    },
    onReady: function() {},
    navigation: function(t) {
        var o = t.currentTarget.dataset, a = o.latitude, n = o.longitude, i = o.name, s = e.BMapTransqqMap(parseFloat(n), parseFloat(a));
        wx.openLocation({
            latitude: s.lat,
            longitude: s.lng,
            scale: 18,
            name: i
        });
    },
    searchChange: function(e) {
        var o = this, a = e.detail;
        this.setData({
            storeName: a
        }), this.timer && clearTimeout(this.timer), this.timer = setTimeout(function() {
            t.default.debounce(o.getStoreListByGoods());
        }, 500);
    },
    callStore: function(t) {
        var e = t.currentTarget.dataset.phone;
        wx.makePhoneCall({
            phoneNumber: e
        });
    },
    getStoreListByGoods: function() {
        var t = this, o = e.getNetAddresss("plugin.travel-around.frontend.goods.goods.getShopAddressByGoods"), a = {
            goods_id: this.data.goodsId,
            store_name: this.data.storeName,
            longitude: this.data.longitude,
            latitude: this.data.latitude
        };
        e._postNetWork({
            url: o,
            data: a,
            success: function(e) {
                var o = e.data;
                console.log(o), 1 == o.result ? t.setData({
                    storeListByGoods: o.data
                }) : wx.showToast({
                    icon: "none",
                    title: o.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});